package com.jack.vipmis.vip.api.web.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jack.vipmis.common.web.controller.BaseController;
import com.jack.vipmis.vip.api.util.MsgUtil;
import com.jack.vipmis.vip.sign.entity.SignMsg;
import com.jack.vipmis.vip.sign.entity.VipSign;
import com.jack.vipmis.vip.sign.service.VipSignService;

/**
 * 用户签到API
 * 
 * @author JackLiang
 * @version 1.0
 * @date 2014-7-15
 */
public class SignApiController extends BaseController<VipSign, Long> {

	@Autowired
	private VipSignService	vipSignService;

	/**
	 * 
	 * @return
	 */
	@RequestMapping(value = "todaySign")
	@ResponseBody
	public Map<String, Object> todaySign(@RequestParam("uId") long userId) {
		try {
			SignMsg m = vipSignService.signThenReturn(userId);
			return MsgUtil.doneOk(m);
		} catch (Exception e) {
			e.printStackTrace();
			return MsgUtil.doneFail();
		}

	}
}
